package day06_exception_collection.com.itheima.d4_collection_travesal;

import java.util.ArrayList;
import java.util.function.Consumer;

public class Demo3_Collection {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("赵敏");
        list.add("小昭");
        list.add("小華");
        list.forEach(new Consumer<String>() {
            @Override
            public void accept(String s) {
                System.out.println("s = " + s);
            }
        });
        list.forEach(s -> System.out.println("s = " + s));
        list.forEach(System.out::println);
    }
}
